<template>
  <div class="recommend-goods views-container">
    <div class="wlm-table">
      <div class="wlm-table-hearder-btn">
        <div class="wlm-table-content">
          <!-- :data="tableFormatData.cannonfodderhis.tableData" @selection-change="handleSelectionChange" -->
          <el-table
            :data="tableData"
            style="width: 100%"
          >
            <el-table-column prop="domain" label="被封域名">
            </el-table-column>
            <el-table-column prop="create_time" label="被封时间">
            </el-table-column>
            <el-table-column prop="" label="操作">
              <template slot-scope="scope">
                   <el-button type="danger" @click="dangerbtn(scope.row.id)">删除</el-button>
                </template>
            </el-table-column>
          </el-table>
     
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getDomainRecord, deleteDomainRecord } from "@/api/operation";

export default {
 
  data() {
    return {
        tableData: [],
    };
  },
  created () {
      this.getDomainRecordbtn()
  },
  methods:{
      getDomainRecordbtn(){
          getDomainRecord().then(res=>{
              if(res.data.code==1){
              this.tableData = res.data.data
              }

          })
      },
      dangerbtn(id){
          this.$confirm("此操作将永久删除该条数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          deleteDomainRecord({ id: id }).then(res => {
            if (res.data.code == 1) {
              this.$message.success(res.data.msg);
              this.getDomainRecordbtn();
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });

      }
  }
};
</script>
